package UI;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

/**
 * Simple shell to display while loading the game state and the game data.
 */
public class GameLoadingShell extends Shell
{
	public GameLoadingShell()
	{
		super(SWTUtil.getDisplay());
		
		FormLayout formLayout = new FormLayout();
		formLayout.marginWidth = 30;
		formLayout.marginHeight = 30;
		
		setLayout(formLayout);
		setMinimumSize(400, 200);
		
		setText("Loading");
		
		Label label = new Label(this, SWT.CENTER);
		label.setText("Please wait, loading...");
		
		FormData formData = new FormData();
		formData.left = new FormAttachment(0, 0);
		formData.top = new FormAttachment(0, 0);
		formData.right = new FormAttachment(100, 0);
		formData.bottom = new FormAttachment(100, 0);
		
		label.setLayoutData(formData);
		
		pack();
	}
	
	@Override
	protected void checkSubclass()
	{
		// Empty on purpose. Makes subclassing Shell possible.
	}
}
